using UnityEngine;
using System.Collections;

public class WinCoins : MonoBehaviour {

    public int wincoins;
    public GUIText showText;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnCollisionEnter(Collision collisionInfo)
    {
        //Debug.Log("WinCoins");
        if(collisionInfo.gameObject.tag == "Coin")
        {
            wincoins++;
            showText.text = wincoins.ToString();
            Destroy(collisionInfo.gameObject);
        }
    }
}
